package com.cloud.sample.controller;

import com.cloud.common.bean.ResultInfo;
import com.cloud.sample.dto.WechatSignDTO;
import com.cloud.sample.provider.WechatProvider;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 微信接口
 */
@Slf4j
@RestController
public class WechatController {

    @Autowired
    private WechatProvider wechatProvider;

    /**
     * 获取签名
     *
     * @param url
     * @return
     */
    @GetMapping("/wechat/getSignature")
    public ResultInfo<WechatSignDTO> get(String url) {
        return ResultInfo.success().setData(wechatProvider.getSignature(url));
    }
}
